Imports Clo = Enhancements.Core.Logging
Imports Ref = System.Reflection
Imports Sys = System

Namespace Enhancements.Basic.Expressions
    ''' <summary>The exception that is thrown when a parsing for a token is not possible.</summary>
    <Serializable(), DebuggerStepThrough()> _
    Public MustInherit Class TokenParseException
        Inherits Exception

        Friend Sub New(ByVal _expression As System.String, ByVal _expressionBeginIndex As Sys.Int32)
            Expression = _expression
            ExpressionBeginIndex = _expressionBeginIndex
        End Sub

        Private __Expression As System.String = Nothing
        ''' <summary>Gets the expression that caused this exception.</summary>
        Public Property Expression() As System.String
            Get
                Return __Expression
            End Get
            Private Set(ByVal _value As System.String)
                __Expression = _value
            End Set
        End Property

        Private __ExpressionBeginIndex As Sys.Int32 = 0
        ''' <summary>Gets the expression begin index that caused this exception.</summary>
        Public Property ExpressionBeginIndex() As Sys.Int32
            Get
                Return __ExpressionBeginIndex
            End Get
            Private Set(ByVal _value As Sys.Int32)
                __ExpressionBeginIndex = _value
            End Set
        End Property

    End Class
End Namespace
